using System;
using System.Collections.Generic;
using System.Text;
using MoEngine;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MoWinLib
{
    public class MasterWindowFormControl : MasterWindow
    {
        public override Vector2 Size
        {
            get { return new Vector2(m_Control.ClientSize.Width, m_Control.ClientSize.Height); }
        }

        protected GraphicsDeviceControl m_Control;

        public MasterWindowFormControl(GraphicsDeviceControl control)
        {
            m_Control = control;
            m_Device = control.GraphicsDevice;
            m_Control.Resize += new EventHandler(OnControlResize);
        }

        void OnControlResize(object sender, EventArgs e)
        {
            OnSizeChanged();
        }

        protected GameTime m_DrawTime;

        public override void Draw(GameTime time)
        {
            m_DrawTime = time;
            m_Control.Invalidate();
        }

        public virtual void DoDraw()
        {
            base.Draw(m_DrawTime);
            //ClearBackground();
            //// only need to draw children
            //m_ChildWnds.DrawAll(m_DrawTime);
        }
    }
}
